﻿// -----------------------------------------------------------------------
// <copyright file="Services.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DC.DCAttribute.Demo
{
    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class Services : IContract 
    {

        public Address GetAddressByFirstName(Contact contact)
        {
            if (contact.FirstName.Equals("Jun"))
            {
                return new Address() { City = "jiujiang", Province = "jiangxi", Country = "china", Street = "changhong" };
            }
            else
            {
                return new Address() { City = "anqing", Province = "anhui", Country = "china", Street = "qingcao" }; 
            }
        }

        public Contact GetContactByCompanyName(Customer customer)
        {
            if (customer.Company.Equals("Rovi"))
            {
                return new Contact()
                {
                    Address = new Address() { City = "jiujiang", Province = "jiangxi", Country = "china", Street = "changhong" },
                    FirstName = "Jun",
                    //LastName = "Hu",
                    PhoneNumber = "13816006002"
                };
            }
            else
            {
                return new Contact()
                {
                    Address = new Address() { City = "anqing", Province = "anhui", Country = "china", Street = "qingcao" },
                    FirstName = "XiaoYu",
                    //LastName = "Feng",
                    PhoneNumber = "13672252532"
                };
            }
        }

        
    }

    public class Services1 : IContract1
    {

        public Address1 GetAddressByFirstName(Contact1 contact)
        {
            if (contact.FirstName.Equals("Jun"))
            {
                return new Address1() { City = "jiujiang", Province = "jiangxi", Country = "china", Street = "changhong" };
            }
            else
            {
                return new Address1() { City = "anqing", Province = "anhui", Country = "china", Street = "qingcao" };
            }
        }

        public Contact1 GetContactByCompanyName(Customer1 customer)
        {
            if (customer.Company.Equals("Rovi"))
            {
                return new Contact1()
                {
                    Address = new Address1() { City = "jiujiang", Province = "jiangxi", Country = "china", Street = "changhong" },
                    FirstName = "Jun",
                    //LastName = "Hu",
                    PhoneNumber = "13816006002"
                };
            }
            else
            {
                return new Contact1()
                {
                    Address = new Address1() { City = "anqing", Province = "anhui", Country = "china", Street = "qingcao" },
                    FirstName = "XiaoYu",
                    PhoneNumber = "13672252532"
                };
            }
        }
    }
}
